package com.mvp.shq.washer.entity;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/9/2.
 */

public class WasherPattern implements Serializable {

    /**
     * id : 1a67d9dcf48d4a64a816c49c9deef61b
     * washerType : d97630f11b664ea58c92912821253b78
     * patternType : 1
     * patternName : 标准
     * patternTime : 30
     * patternPrice : 0.01
     * des : 标准洗
     */

    private String id;
    private String washerType;
    private String patternType;
    private String patternName;
    private int patternTime;
    private BigDecimal patternPrice;
    private String des;
    private boolean selected = false;

    public static WasherPattern objectFromData(String str) {

        return new Gson().fromJson(str, WasherPattern.class);
    }

    public static List<WasherPattern> arrayWasherPatternFromData(String str) {

        Type listType = new TypeToken<ArrayList<WasherPattern>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getWasherType() {
        return washerType;
    }

    public void setWasherType(String washerType) {
        this.washerType = washerType;
    }

    public String getPatternType() {
        return patternType;
    }

    public void setPatternType(String patternType) {
        this.patternType = patternType;
    }

    public String getPatternName() {
        return patternName;
    }

    public void setPatternName(String patternName) {
        this.patternName = patternName;
    }

    public int getPatternTime() {
        return patternTime;
    }

    public void setPatternTime(int patternTime) {
        this.patternTime = patternTime;
    }

    public BigDecimal getPatternPrice() {
        return patternPrice;
    }

    public void setPatternPrice(BigDecimal patternPrice) {
        this.patternPrice = patternPrice;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }
}
